package cn.livingCloud.dto;

import cn.livingCloud.entity.core.CaseComments;
import cn.livingCloud.entity.user.Member;
import cn.livingCloud.utils.DateUtils;

/**
 * Created by 唐旭 on 2016/6/14.
 */
public class CaseCommentSubmitJsonDto extends JsonDto {
    private String createDateTime;
    private String content;
    private String headimgurl;
    private boolean member = true;

    public CaseCommentSubmitJsonDto() {
    }

    public CaseCommentSubmitJsonDto(CaseComments comments) {
        this.createDateTime = DateUtils.toDateText(comments.getCreateDateTime()
                , DateUtils.DEFAULT_DATE_TIME_FORMAT);
        this.content = comments.getContent();
        Member member = comments.getMember();
        if (member != null) {
            this.headimgurl = member.getHeadimgurl();
            this.member = true;
        } else {
            this.member = false;
        }
    }

    public String getContent() {
        return content;
    }

    public CaseCommentSubmitJsonDto setContent(String content) {
        this.content = content;
        return this;
    }

    public String getCreateDateTime() {
        return createDateTime;
    }

    public CaseCommentSubmitJsonDto setCreateDateTime(String createDateTime) {
        this.createDateTime = createDateTime;
        return this;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public CaseCommentSubmitJsonDto setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
        return this;
    }

    public boolean isMember() {
        return member;
    }

    public CaseCommentSubmitJsonDto setMember(boolean member) {
        this.member = member;
        return this;
    }
}
